<template>
    <div id="chart" style="height: 400px"></div>
</template>
  
<script lang="ts">
import * as echarts from 'echarts'
//   import { use,  } from 'vue-echarts'

export default {
    name: 'Chart',

    mounted() {
        const chartDom: HTMLElement = document.getElementById('chart')!
        const myChart: echarts.ECharts = echarts.init(chartDom)
        const option: echarts.EChartsOption = {
            title: {
                text: '每日积分变化榜',
            },
            tooltip: {
                trigger: 'axis',
            },
            xAxis: {
                type: 'category',
                data: ['3.12', '3.13', '3.14', '3.15', '3.16','3.17','3.18','3.19'],
            },
            yAxis: {
                type: 'value',
                min: 0,
                max: 100,
                axisLabel: {
                    formatter: '{value} 分',
                },
            },
            series: [
                {
                    data: [90, 85, 95, 92, 96,90,88,76],
                    type: 'line',
                    smooth: true,
                },
            ],
        }
        myChart.setOption(option)
    },
}
</script>
  